package com.youkeyi.ddy.cloud.common.api.application.business.storage.stock;

import com.youkeyi.ddy.cloud.common.api.application.business.storage.stock.dto.BusinessStockListCloudDto;
import com.youkeyi.ddy.cloud.common.api.application.business.storage.stock.param.BusinessStockCreateCloudParam;
import com.youkeyi.ddy.cloud.common.api.application.business.storage.stock.param.BusinessStockListCloudParam;
import com.youkeyi.ddy.cloud.common.response.ResponseContent;
import io.swagger.annotations.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 系统库存
 *
 * @author  liuxiawang
 * @Date 5/24/22 10:36 PM
 * @Location shenzhen.china
 */
@Api(tags = {"【BUSINESS】Stock management"})
@RestController
@FeignClient(value = "YOUKEYI-DDY-CLOUD-APPLICATION-BUSINESS", fallback = BusinessStockCloudServiceFallback.class)
@RequestMapping("/business/stock")
public interface BusinessStockCloudService {

    // 查询库存列表
    @ApiOperation(value = "Query Business Stock List", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.storage.stock.BusinessStockCloudService.list")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = BusinessStockListCloudDto.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "query", value = "Param of Query Business Stock List", dataType = "BusinessStockListCloudParam", dataTypeClass = BusinessStockListCloudParam.class),
    })
    @GetMapping
    public abstract BusinessStockListCloudDto list(BusinessStockListCloudParam param);

    // 创建库存
    @ApiOperation(value = "Create Business Stock", authorizations = {@Authorization("com.youkeyi.ddy.cloud.common.api.application.business.storage.stock.BusinessStockCloudService.create")})
    @ApiResponse(code = 200, message = "data Property in Response Body", response = ResponseContent.class)
    @ApiImplicitParams({
            @ApiImplicitParam(name = "param", paramType = "body", value = "Param of Create Business Stock", dataType = "BusinessStockCreateCloudParam", dataTypeClass = BusinessStockCreateCloudParam.class),
    })
    @PostMapping("/create")
    public abstract ResponseContent create(@RequestBody BusinessStockCreateCloudParam param);

}
